from django_filters.rest_framework import FilterSet
from django_filters.filters import *

from apps.goods.models import Goods

class SalesSales_GoodsFilter(FilterSet):
    start_date = DateFilter(field_name='sales_goods_set__sales_order__handle_time', lookup_expr='gte',
                                    label='开始日期')
    end_date = DateFilter(field_name='sales_goods_set__sales_order__handle_time', lookup_expr='lt',
                                  label='结束日期')

class Meta:
        model = Goods
        fields = ['start_date', 'end_date']

__all__ = [
    'SalesSales_GoodsFilter'
]
